package util;

public class Casella {
	private int x, y;

	public Casella(int x, int y) {
		super();
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public boolean eSopra(Casella c) {
		if (x < c.getX()) {
			return true;
		}
		return false;
	}

	@Override
	public boolean equals(Object casella) {
		if(!(casella instanceof Casella)){
			return false;
		}
		if(this==casella){
			return true;
		}
		Casella c = (Casella) casella;
		return (getX()==c.getX() && getY()==c.getY());
	}
	
	@Override
	public String toString() {
		String s = "["+getX()+","+getY()+"]";
		return s;
	}
	
	@Override
	public int hashCode() {
		return toString().hashCode();
	}

}